#include<bits/stdc++.h>
using namespace std;
#define int long long
int read()
{
    int a=0,b=1;
    char c='\0';
    while(c<'0' || c>'9')
    {
        if(c=='-')
        {
            b*=-1;
        }
        c=getchar();
    }
    while(c>='0' && c<='9')
    {
        a=(a<<3)+(a<<1)+(c-'0');
        c=getchar();
    }
    return a*b;
}

const int MAXN=100005;
int a[MAXN];
bool vis[MAXN];

signed main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    int maxn=0,t=0;
    for(int i=0;i<n;i++)
    {
        a[i]=read();
        maxn=max(a[i],maxn);
        if(a[i]==2)
        {
            t++;
        }
    }
    if(maxn==2)
    {
        cout<<max(n-t,t)<<endl;
        return 0;
    }
    sort(a,a+n);
    int ans=0;
    for(int i=1;i<n;i++)
    {
        for(int j=i-1;j>=0;j--)
        {
            if(a[j]<a[i] && !vis[j])
            {
                ans++;
                vis[j]=1;
                break;
            }
        }
    }
    printf("%lld",n-ans);
    return 0;
}
